package com.xmall.order.define.dict;

import com.xmall.annotation.Dict;

/**
 * 退款退货状态
 */
@Dict
public enum RefundStatusEnum {

    WAIT_AUDIT("审核中", 0), APPROVE("同意", 1),
    REFUSE("拒绝", 2), WAIT_RECEIVE("待卖家收货", 3),
    RECEIVED("卖家已收货", 4), FINISH_REFUND("已退款", 5),
    CANCELED("已取消", 6);

    private String name;

    private Integer status;

    RefundStatusEnum(String name, Integer status) {
        this.name = name;
        this.status = status;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getStatus() {
        return status;
    }

    public static String getNameByStatus(Integer status) {
        for (RefundStatusEnum value : values()) {
            if(value.getStatus() == status) {
                return value.getName();
            }
        }
        return "";
    }
}
